﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HZ.Supervise.Web.Common
{
    public partial class FindProductName : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            dataBind();
            
        }

        public void dataBind()
        { 
            HZ.Supervise.BLL.BLL_ProcureCatalog pro = new HZ.Supervise.BLL.BLL_ProcureCatalog();
            Model.Query.ProcureCatalog mpro = new HZ.Supervise.Model.Query.ProcureCatalog();
            int count = 0;
            if (!string.IsNullOrEmpty(this.txtProName.Text.Trim()))
            {
                mpro.ProductName = this.txtProName.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtProID.Text.Trim()))
            {
                mpro.ProcureCatalogID = this.txtProID.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtOutlookc.Text.Trim()))
            {
                mpro.Outlookc = txtOutlookc.Text.Trim();
            }
            if (!string.IsNullOrEmpty(txtComPs.Text.Trim()))
            {
                mpro.CompanyName_SC = txtComPs.Text.Trim();
            }
            mpro.SortFields = "ProcureCatalogID ";
           this.gvwProList.DataSource = pro.GetProcureCatalogByWhere(mpro, AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, out count);
           this.gvwProList.DataBind();
           this.AspNetPager1.RecordCount = count;
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            dataBind();
        }

        protected void btnQery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            dataBind();
        }
    }
}
